﻿<%@ Page Title="" Language="C#" MasterPageFile="~/View/MasterPage.Master" AutoEventWireup="true" CodeBehind="ListBusinesses.aspx.cs" Inherits="GRC_TPE_WebApp.View.Private.Business.ListBusinesses" %>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    
    <fieldset>
        <legend>Filtres</legend>
        Laissez les champs vide pour ne pas filtrer
        <table class="contentTable">
            <tr>
                <td>Titre:</td>
                <td><asp:TextBox ID="TB_FilterTitre" runat="server" Width="220px"></asp:TextBox></td>
            </tr>
            <tr>
                <td>Statut:</td>
                <td>
                    <asp:DropDownList ID="DDL_State" runat="server">
                        <asp:ListItem Text="Tous" Value="Tous" />
                        <asp:ListItem Text="Gagnée" Value="Gagnée" />
                        <asp:ListItem Text="Perdue" Value="Perdue" />
                        <asp:ListItem Text="Prospect" Value="Prospect" />
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>Client:</td>
                <td><asp:TextBox ID="TB_FilterClient" runat="server" Width="220px"></asp:TextBox></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td><asp:Button ID="B_Filter" runat="server" Text="Filtrer" 
                        onclick="B_Filter_Click" /></td>
                <td></td>
                <td><asp:Button ID="B_Clear" runat="server" Text="Réinitialiser" 
                        onclick="B_Clear_Click" /></td>
            </tr>
        </table>
    </fieldset>
    
    <asp:ListView ID="LV_Business" runat="server" DataKeyNames="Id" 
        DataSourceID="DS_Business" GroupItemCount="1">
        <AlternatingItemTemplate>
            <td runat="server" style="background-color:#d4e3f3;">
                <table class="contentTable">
                    <tr>
                        <td class="td_left">Titre:</td>
                        <td><asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Statut:</td>
                        <td><asp:Label ID="StateLabel" runat="server" Text='<%# Eval("State") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Montant:</td>
                        <td><asp:Label ID="AmountLabel" runat="server" Text='<%# Eval("Amount") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Description:</td>
                        <td><asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Client:</td>
                        <td><asp:Label ID="ClientLabel" runat="server" Text='<%# Eval("Client.Name") %>' /></td>
                    </tr>
                     <tr>
                        <td><asp:Button ID="B_Delete" runat="server" Text="Supprimer" onclick="B_Delete_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                        <td><asp:Button class="Update_button" runat="server" Text="Modifier" onclick="Update_button_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                    </tr>
                </table>
            </td>
        </AlternatingItemTemplate>
        <EmptyDataTemplate>
            <table class="contentTable" runat="server" 
                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                <tr>
                    <td>
                        Aucune affaire en base.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
            <td runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        
        <ItemTemplate>
            <td runat="server" style="background-color:#eaf3f9;color: #000000;">
                <table class="contentTable">
                    <tr>
                        <td class="td_left">Titre:</td>
                        <td><asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Statut:</td>
                        <td><asp:Label ID="StateLabel" runat="server" Text='<%# Eval("State") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Montant:</td>
                        <td><asp:Label ID="AmountLabel" runat="server" Text='<%# Eval("Amount") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Description:</td>
                        <td><asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Client:</td>
                        <td><asp:Label ID="ClientLabel" runat="server" Text='<%# Eval("Client.Name") %>' /></td>
                    </tr>
                     <tr>
                        <td><asp:Button ID="B_Delete" runat="server" Text="Supprimer" onclick="B_Delete_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                        <td><asp:Button class="Update_button" runat="server" Text="Modifier" onclick="Update_button_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                    </tr>
                </table>
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server" class="contentTable">
                <tr runat="server">
                    <td runat="server">
                        <table class="contentTable" ID="groupPlaceholderContainer" runat="server" border="1" 
                            style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" 
                        style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                        <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowLastPageButton="True" FirstPageText="Premier" LastPageText="Dernier" NextPageText="Suivant" PreviousPageText="Précédent" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:ListView>
    <asp:EntityDataSource ID="DS_Business" runat="server" 
        ConnectionString="name=Model_GRC_TPEContainer" 
        DefaultContainerName="Model_GRC_TPEContainer" EntitySetName="BusinessSet" 
        EntityTypeFilter="Business" Include="Client">
    </asp:EntityDataSource>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="footer" runat="server">
</asp:Content>